| Total Complexity | 7 |
| Total Lines | 20 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | const providers = {} |
||
| 13 | class ExternalScriptLoader { |
||
| 14 | constructor () { |
||
| 15 | console.warn('ExternalScriptLoader is deprecated since version 1.4.0 with no alternative available.') |
||
| 16 | if (!instance) { |
||
| 17 | instance = this |
||
| 18 | } |
||
| 19 | return instance |
||
|
|
|||
| 20 | } |
||
| 21 | |||
| 22 | static getInstance () { |
||
| 23 | return instance || new ExternalScriptLoader() |
||
| 24 | } |
||
| 25 | |||
| 26 | initialize (type, options = {}) { |
||
| 27 | if (!this[type]) { |
||
| 28 | this[type] = providers[type](options) |
||
| 29 | } |
||
| 30 | return this[type] |
||
| 31 | } |
||
| 32 | } |
||
| 33 | |||
| 35 |